package com.learn.rmi;

import java.lang.management.ManagementFactory;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

/**
 * @author wangxing
 * @version 2020/7/4 15:31 Administrator
 */
public class RmiClient {
    public static void main(String[] args) throws RemoteException, NotBoundException, MalformedURLException {
        IUserService service = (IUserService) Naming.lookup("rmi://192.168.1.2:8888/UserService");
        System.out.println("引用成功" + ManagementFactory.getRuntimeMXBean().getName());
        System.out.println(service.getName(11));
    }
}
